<template>
	<view class="ordersbox">
		<view class="text">
			<view class="title">
				<text><text style="font-weight: bold;color: #666;">举报编号：</text><text style="margin-left: 1em;">{{item.reportNumber}}</text></text>
			</view>
			<view>
				<text><text style="font-weight: bold;color: #666;">被举报类型：</text><text>{{item.reportedType===1?'网站':(item.reportedType===2?'APP':'网络平台')}}</text></text>
		    </view>
			<view>
				<text><text style="font-weight: bold;color: #666;">危害类型：</text><text style="margin-left: 1em;">{{this.harmTypeName}}</text></text>
			</view>
			<view>
				<text><text style="font-weight: bold;color: #666;">网站名称：</text><text style="margin-left: 1em;">{{item.name}}</text></text>
			</view>
		</view>
		<view class="btn">
			<u-button class="custom-style"  type="text" text="详情" icon="search" iconColor="#4095E5" ></u-button>
		</view>
	</view>
</template>

<script>
	import{HARM_TYPE_LIST} from '../../utils/constant.js'
	export default {
		name:"ordersbox",
		props:{
			item:{
				type:Object,
				default(){
					return{
						acceptorId: null,
						acceptorReason: null,
						auditorId: null,
						count: null,
						createBy: 0,
						createTime: "2023-07-07 00:26:37",
						endTime: null,
						extraContent: "111",
						fileIds: null,
						handlerId: null,
						handlerReason: null,
						harmType: 1,
						id: "1676991048058912769",
						isDeleted: "0",
						locationId: null,
						name: "baidu",
						orgId: null,
						platformId: 1,
						reason: null,
						reportContent: "111",
						reportNumber: "2023-07-070001",
						reportStatue: 0,
						reportType: 2,
						reportedType: 1,
						reporterEmail: null,
						reporterId: null,
						reporterName: null,
						reporterPhone: null,
						reporterSex: null,
						updateBy: 0,
						updateTime: "2023-07-07 00:26:37",
						webAddress: "",
					}
				}
			}
		},
		created() {
			this.init()
		},
		data() {
			return {
				harmTypeName:'',
			};
		},
		methods:{
			init(){
				for(let i =0 ;i<HARM_TYPE_LIST.length;i++){
					if(this.$props.item.harmType===HARM_TYPE_LIST[i].value){
						this.harmTypeName=HARM_TYPE_LIST[i].label;
					}
				}
			},
			// detail(){
			// 	uni.navigateTo({
			// 		url:'/pages/detailReal/detailReal'
			// 	})
			// }
		}
	}
</script>

<style lang="scss">
.ordersbox{
	padding: 20rpx;
	display: flex;
	border-radius: 5px;
	box-shadow: 0 0 5px 1px rgba($color:#24A7FE, $alpha: 0.5);
	.text{
		display: flex;
		flex:1;
		padding-left:20rpx;
		flex-direction: column;
		justify-content: space-between;
		.title{
			color: #333;
			text-overflow: -o-ellipsis-lastline;
			overflow: hidden;
			text-overflow: ellipsis;
			display: -webkit-box;
			-webkit-line-clamp: 2;
			line-clamp: 2;
			-webkit-box-orient: vertical;
		}
	}
	.btn{
		margin-top: 1.5em;
		.custom-style {
			color: #4095E5;
	}
	}
}
</style>